<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="container"></div>
  <script src="/xuni/bundle.js"></script>
  <script>
    // 模板字符串
    var templateStr = `
    <div>
      <ul>
        {{#students}}
          <li>
            学生{{name}}的爱好是
            <ul>
              {{#hobbies}}
                <li>{{.}}</li>
              {{/hobbies}}
            </ul>
          </li>
        {{/students}}
      </ul>
    </div>
    `;
    // 数据
    var data = {
      students: [
        { 'name': '小明', 'hobbies': ['游泳', '健身'] },
        { 'name': '小红', 'hobbies': ['足球', '篮球', '羽毛球'] },
        { 'name': '小强', 'hobbies': ['吃饭', '睡觉'] }
      ]
    }
    // 调用render
    var domStr = awei_TemplateEngline.render(templateStr, data)
    // 渲染上树
    var container = document.getElementById('container')
    container.innerHTML = domStr
  </script>
</body>

</html>